<script setup lang="ts">
import ChildInput from './ChildInput.vue';
import { ref } from 'vue';
let username = ref('张三')


</script>
<template>
    <div class="father">
        <h2>我是父组件</h2>
        <!-- v-model用于输入框上 -->
        <!-- <input type="text" v-model="username"> -->
        <!-- <input type="text" :modelValue="username" @input="username=(<HTMLInputElement >$event.target).value"> -->
        <!--v-model用于标签中  -->
        <ChildInput v-model="username"></ChildInput>
        <!-- <ChildInput :modelValue="username" @update:modelValue="username=$event"></ChildInput> -->
        
    </div>
</template>
<style lang="css" scoped>
.father {
    width: 800px;
    padding-left: 20px;
    height: 100%;
    background-color: gray;
}

input {
    height: 36px;
    font-size: 16px;
}
</style>